import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Details from '../views/Details.vue'
import Cook from '../views/homeCook/Cook.vue'
import Cate from '../views/homeCook/Cate.vue'
import Myhome from '../views/homeCook/Myhome.vue'
import TestComp from '../views/test/TestComp.vue'
import myhome3Son from '@/views/homeCook/myhomeout/myhome3Son.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: 'home',
  },
  {
    path:'/home',
    component:Home,
    redirect:"/home/cook",
    children:[
      {
        path:'cook',
        component:Cook
      },
      {
        path:'cate',
        component:Cate
      },
      {
        path:'myhome',
        component:Myhome,
      },
    ]

    
  },
  {
     path:'/details',
     component:Details,
     children:[
      {
        path:'myhomes',
        component:()=>import("@/views/homeCook/myhomeout/Myhome1")
      },
      {
        path:'myhome2',
        component:()=>import("@/views/homeCook/myhomeout/Myhome2")
      },
      {
        path:'myhome3',
        component:()=>import("@/views/homeCook/myhomeout/Myhome3"),

      },
      {
        path:'myhome4',
        component:()=>import("@/views/homeCook/myhomeout/Myhome4")
      },
      {
        path:'myhome5',
        component:()=>import("@/views/homeCook/myhomeout/Myhome5")
      },
      {
        path:'myhome6',
        component:()=>import("@/views/homeCook/myhomeout/Myhome6")
      },  
      {
        path:'iconame',
        component:()=>import("@/components/ico/icoName"),
        name:'iconame',
      }, 
      {
        path:'satname',
        component:()=>import("@/components/ico/satName"),
        name:'satname',
      },

     ],
    

  },

  {
    path: '/test',
    component: TestComp
  },
  {
    path:'/myhome3Son', 
    component:myhome3Son,
    name:"myhome3Son"
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
